package jee.boot.module.bpm.rest;

import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.Page;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.entity.bpm.BusinessTable;
import jee.boot.module.bpm.service.BusinessTableService;
import jee.boot.module.bpm.table.mysql.model.FormTable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 表单设计_业务实体表
 */
@RestController
@RequestMapping("/businessTable")
public class BusinessTableRestController extends CrudController<BusinessTableService, BusinessTable> {
    /**
     * 列表
     *
     * @param entity
     * @return
     */
    @PostMapping("/tableList")
    public ResponseMessage<Page<FormTable>> tableList(@RequestBody FormTable entity) {
        Page<FormTable> list = service.tableList(entity);
        return Result.success(list);
    }
    /**
     * 列表
     *
     * @param entity
     * @return
     */
    @PostMapping("/getFromTable")
    public ResponseMessage<BusinessTable> getFromTable(@RequestBody FormTable entity) {
        BusinessTable table = service.getFromTable(entity);
        return Result.success(table);
    }
}
